package com.lei.springbootpractice.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value="cart")
public class CartPojo {
    @TableId(value="cart_id",type= IdType.ASSIGN_ID)
    private String cartId;

    // 用户id外键
    @TableField(value="user_id")
    private String userId;

    @TableField(value="quantity")
    private int quantity;

    @TableField(exist = false)
    private String productId; // 用于添加商品时临时存储productId

    @TableField(exist = false)
    private List<ProductBunchPojo> productBunches;
}